void setTime() {
  
static boolean hourPressed=false, minPressed=false; //track button state


  if (digitalRead (minutePin)==LOW && minPressed == false) {// if a normally closed switch is pressed

      if (minute == 59) minute = -1; // sets minute to -1 if minutes = 59 to begin at 0 again

      minute++; 
      RTC.stop();
      RTC.set(DS1307_SEC,0);        
      RTC.set(DS1307_MIN,minute);   
      RTC.set(DS1307_HR,hour);      
      //RTC.set(DS1307_DOW,4);      
      //RTC.set(DS1307_DATE,5);     
      //RTC.set(DS1307_MTH,3);      
      //RTC.set(DS1307_YR,9);       
      RTC.start();
      lc1.clearDisplay(0);
      minPressed = true;            // note the pressed state
  }
  
  if (digitalRead (minutePin)==HIGH) minPressed = false; // reset the state when the button is released

      if (digitalRead (hourPin)==LOW && hourPressed == false) {

          if (hour == 23) hour = -1; // sets hour to -1 if hour > 23 to begin at 0 again
          hour++; 
          RTC.stop();
          RTC.set(DS1307_SEC,0);        
          RTC.set(DS1307_MIN,minute);   
          RTC.set(DS1307_HR,hour);      
          //RTC.set(DS1307_DOW,4);      
          //RTC.set(DS1307_DATE,5);     
          //RTC.set(DS1307_MTH,3);      
          //RTC.set(DS1307_YR,9);       
          RTC.start();  
          lc1.clearDisplay(0);
          hourPressed = true;          // note the pressed state
  }
  

  if (digitalRead (hourPin)==HIGH) hourPressed = false;

}
